<?php
function GetCurrLang() {
	$uri = $_SERVER["REQUEST_URI"];
	$pos = strrpos($uri, "/en");
	$lang = $pos > 0 ? "en" : "th";
	return $lang;
}

function GetCurrURL($curr_lang = FALSE, $select_lang = FALSE) {
	$uri = $_SERVER["REQUEST_URI"];
	$url = $curr_lang == $select_lang ? $uri : str_replace('/' . $curr_lang, '/' . $select_lang, $uri);
	return $url;
}

function GetMenuProperty($id, $field) {
	$CI = &get_instance();
	$result = $CI -> db -> getone("SELECT " . $field . " from admin_menu where id=" . $id);
	return $result;
}
?>
